import http from "@/api/index";

// 用户登录
export const login = (params: ReqLoginForm) => {
  return http.post<BaseResponse<LoginData>>(`/auth/login`, params);
};

// 用户信息
export const getUserInfo = () => {
  return http.get(`/manager/self`);
};

// 修改用户信息
export const editUserInfo = data => {
  return http.post<BaseResponse>(`/manager/update/self`, data);
};

// 用户菜单
export const getMenu = () => {
  return http.get(`/menu/get_auth_menu`);
};

// 退出登录
export const logout = () => {
  return http.post(`/auth/login`);
};

export interface ReqLoginForm {
  account: string;
  password: string;
}
interface LoginData {
  account: string;
  password: string;
  exp: number;
  is_super: number;
  manage_id: number;
  status: number;
  token: string;
}
